@"%~dp0\..\tyle\tylerun.bat" "%~0"
//
projectPath=$[0];
projectPath[-1]!='\' ? (projectPath+='\';);
httpPath=projectPath >> @'subleme\';

include(httpPath+'setup.tyle');

putline('If this is the first installation, the username and password will be "Admin" (First letter is capital).');
putline('No not skip this setup when installing a new version.');
putline(' ');

settings=
{   
    {"Give port number", 'port'},
    {"Give html for logo",'logo'},
    {"Give color of logo",'logoColor'},
    {"Give width of logo",'logoWidth'},
    {"Give path to where data should be stored",'dbPath'},
    {"Give session expiration in minutes",'expiration'}
};

settings:!askSetting!;
askCertificateSettings!;
conserveSetting('pwCheck');

saveSettings!;

setupEncryption!; // this should be done after reload of settings

putline('Do you want to start the server? (y/n)');
uncaps(gets!)!='n' ?
(
  putline('Starting server...');
  sys(cmd{'"',projectPath,'start.bat"'});
  sleep(3000);
  putline('It can take a while until the server is up. Wait until log file comes up, then it is ready.');
  putline('When ready, press <enter>.');
  gets!;
  sys(cmd{'explorer "http://localhost:',port,'/login.tsp"'});
);
#q
